import request from './request'

// 认证相关API
export const login = (data) => request.post('/auth/login', data)
export const logout = () => request.post('/auth/logout')
export const getUserInfo = () => request.get('/auth/userinfo')

// 教师管理API
export const getTeachers = (params) => request.get('/teachers', { params })
export const createTeacher = (data) => request.post('/teachers', data)
export const updateTeacher = (id, data) => request.put(`/teachers/${id}`, data)
export const deleteTeacher = (id) => request.delete(`/teachers/${id}`)

// 课程管理API
export const getCourses = (params) => request.get('/courses', { params })
export const createCourse = (data) => request.post('/courses', data)
export const updateCourse = (id, data) => request.put(`/courses/${id}`, data)
export const deleteCourse = (id) => request.delete(`/courses/${id}`)

// 班级管理API
export const getClasses = (params) => request.get('/classes', { params })
export const createClass = (data) => request.post('/classes', data)
export const updateClass = (id, data) => request.put(`/classes/${id}`, data)
export const deleteClass = (id) => request.delete(`/classes/${id}`)

// 场地管理API
export const getVenues = (params) => request.get('/venues', { params })
export const createVenue = (data) => request.post('/venues', data)
export const updateVenue = (id, data) => request.put(`/venues/${id}`, data)
export const deleteVenue = (id) => request.delete(`/venues/${id}`)

// 排课相关API
export const autoSchedule = (data) => request.post('/schedule/auto', data)
export const previewSchedule = (params) => request.get('/schedule/preview', { params })
export const confirmSchedule = (data) => request.post('/schedule/confirm', data)
export const getClassSchedule = (id) => request.get(`/schedule/class/${id}`)
export const getTeacherSchedule = (id) => request.get(`/schedule/teacher/${id}`)
export const getCalendarData = (params) => request.get('/schedule/calendar', { params })
export const adjustSchedule = (data) => request.put('/schedule/adjust', data)